<template>
  <div class="colorSystem">
    <div class="title">搜索页</div>
    <div class="colorSystem-content">
      <div class="setUp-style">
        <div
          v-for="item in colordata"
          :key="item.name"
          :class="['item', { checkedItem: checkedItem.name == item.name }]"
          @click="checked(item)"
        >
          <span>{{ item.name }}</span>
          <ul v-if="item.name !== '自定义风格'" class="colorBox">
            <li :style="`background:${item.color[0]};`" />
            <li :style="`background:${item.color[1]};`" />
          </ul>
          <ul v-else class="colorBox">
            <li :style="`background:${item.color[0]};`" />
            <li :style="`background:${item.color[1]};`" />
          </ul>
        </div>
      </div>
      <div class="simplePic">
        <div class="itemPics">
          <div class="scollBoxs">
            <img
              src="//cdn2.weimob.com/saas/@assets/saas-fe-retail-web-stc/retail/images/store/storeStyle/1.png?v=02"
              alt=""
            >
            <div :style="`color:${checkedItem.color[0]};`" class="priceText">¥<span style="font-size: 18px">800</span>.00</div>
            <div :style="`color:${checkedItem.color[0]};border-color:${checkedItem.color[0]};`" class="goodType">黄</div>
            <div :style="`color:${checkedItem.color[0]};border-color:${checkedItem.color[0]};`" class="goodColor">M</div>
            <div class="picOneBox">
              <div :style="`background: ${checkedItem.color[1]}`" class="subAdd">加入购物车</div>
              <div :style="`background: ${checkedItem.color[0]}`" class="subBuy">立即购买</div>
            </div>
          </div>
        </div>
        <div class="itemPics">
          <div class="scollBoxs">
            <img
              src="//cdn2.weimob.com/saas/@assets/saas-fe-retail-web-stc/retail/images/store/storeStyle/2.png?v=02"
              alt=""
            >
            <div :style="`background: ${checkedItem.color[0]}`" class="cartDel">删除</div>
            <div :style="`color:${checkedItem.color[0]};`" class="cartPrice">¥1154.00</div>
            <div :style="`background: ${checkedItem.color[0]}`" class="cartSub">去结算</div>
          </div>
        </div>
        <div class="itemPics">
          <div class="scollBoxs">
            <img
              src="//cdn2.weimob.com/saas/@assets/saas-fe-retail-web-stc/retail/images/store/storeStyle/3.png?v=02"
              alt=""
            >
            <div :style="`color:${checkedItem.color[0]};`" class="orderPrice">¥184.00</div>
            <div :style="`color:${checkedItem.color[0]};`" class="orderPay">¥170.00</div>
            <div :style="`background: ${checkedItem.color[0]}`" class="orderSub">提交订单</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      colordata: [
        { name: '风格一', color: ['rgb(250, 104, 104)', 'rgb(255, 181, 108)'] },
        { name: '风格二', color: ['rgb(245, 111, 166)', 'rgb(69, 69, 82)'] },
        { name: '风格三', color: ['rgb(232, 90, 113)', 'rgb(69, 69, 82)'] },
        { name: '风格四', color: ['rgb(134, 185, 2)', 'rgb(69, 69, 82)'] },
        { name: '风格五', color: ['rgb(64, 186, 255)', 'rgb(69, 69, 82)'] },
        { name: '自定义风格', color: ['', ''] }
      ],
      checkedItem: { name: '风格一', color: ['rgb(250, 104, 104)', 'rgb(255, 181, 108)'] }
    }
  },
  methods: {
    checked(val) {
      this.checkedItem = val
    }
  }
}
</script>
<style lang="less" scoped>
.colorSystem {
  padding: 20px 5px;
  .title {
    color: #595961;
    font-size: 16px;
    padding: 0 0 20px 0;
  }
  .colorSystem-content {
    background: #f2f2f6;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    overflow: auto;
    width: 100%;
    .setUp-style {
      width: 230px;
      height: 337px;
      background: #fff;
      border: 1px solid #e3e2e5;
      border-radius: 6px;
      padding: 5px 5px 0px 5px;
      .item {
        width: 220px;
        height: 50px;
        margin-bottom: 5px;
        overflow: hidden;
        cursor: pointer;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0 5px;
        font-family: PingFangSC-Semibold;
        font-size: 14px;
        color: #595961;
        line-height: 24px;
        font-weight: 600;
        &:hover {
          background: #f2f2f6;
          border-radius: 5px;
        }

        ul {
          margin: 0;
        }
        span {
          display: block;
          white-space: nowrap;
        }
        li {
          float: right;
          width: 30px;
          height: 30px;
          margin-left: 10px;
          border-radius: 4px;
          border: 1px solid #e1e0e6;
          background: #f8f8f8;
          padding: 0;
        }
      }
      .checkedItem {
        background: #f2f2f6;
        border-radius: 5px;
      }
    }
  }
}
.simplePic {
  white-space: nowrap;
  color: #fff;
}
.itemPics {
  width: 360px;
  display: inline-block;
  margin-left: -97px;
  vertical-align:middle;
  font-size: 0;
  &:first-child {
    margin-left: 13px;
  }
  .scollBoxs {
    transform: scale(0.7, 0.7);
    transform-origin: 0 0;
    font-size: 12px;
    img {
      width: 100%;
      vertical-align: middle;
    }
  }
  .priceText {
    position: absolute;
    top: 211px;
    left: 125px;
    display: flex;
    align-items: baseline;
  }
  .goodType,
  .goodColor {
    position: absolute;
    top: 357px;
    left: 96px;
    width: 30px;
    height: 30px;
    border: 1px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .goodColor {
    top: 449px;
  }
  .picOneBox {
    position: absolute;
    bottom: 45px;
    left: 2px;
    width: 358px;
    height: 44px;
    color: #fff;
    text-align: center;
    overflow: hidden;
    .subAdd,
    .subBuy {
      float: left;
      width: 178px;
      line-height: 40px;
      border: 0;
      font-size: 14px;
      vertical-align: middle;
      margin: 0;
      padding: 0;
    }
  }
  .cartDel, .cartSub,.orderSub{
    font-size: 14px;
    position: absolute;
    width: 58px;
    height: 98px;
    background: #fff;
    top: 109px;
    right: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .cartPrice, .orderPrice, .orderPay{
    display: block;
    position: absolute;
    bottom: 115px;
    right: 127px;
  }
  .cartSub {
    width: 115px;
    height: 47px;
    top: 543px;
    right: 1px;
  }
  .orderPrice{
    bottom: 269px;
    right: 18px;
  }
  .orderPay {
    bottom: 57px;
    right: 248px;
    font-size: 14px;
  }
  .orderSub {
    width: 115px;
    height: 49px;
    top: 587px;
    right: 2px;
  }
}
</style>
